<?php

use App\Http\Controllers\BLWAPIController;
use App\Http\Controllers\FieldEncryptController;
use App\Http\Controllers\IndexController;
use App\Http\Controllers\Live\ActivityController;
use App\Http\Controllers\Live\ShopController;
use App\Http\Controllers\OnePanelAPIController;
use App\Http\Controllers\Review\MenuController;
use App\Http\Middleware\VerifyClientBookMiddleware;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
    return $request->user();
});
Route::post('/shop/encstr',[FieldEncryptController::class,'encStr'])->middleware([VerifyClientBookMiddleware::class]);
Route::post('/shop/decstr',[FieldEncryptController::class,'decStr'])->middleware([VerifyClientBookMiddleware::class]);
Route::post('/shop/sign',[FieldEncryptController::class,'sign']);
Route::post('/lock/test',[IndexController::class,'testLock']);
Route::group([],function () {
 Route::post('/review/admin/newmenu',[MenuController::class,'newMenu']);
 Route::post('/review/admin/changemenu',[MenuController::class,'changeMenu']);
 Route::post('/review/admin/deletemenu',[MenuController::class,'deleteMenu']);
 Route::post('/blw/test',[BLWAPIController::class,'test'])->name('api.blw.test');
 Route::post('/blw/modifychannelname',[BLWAPIController::class,'modifyChannelName'])->name('api.blw.modifychannelname');
 Route::post('/onepanel/installedlist',[OnePanelAPIController::class,'getInstalledList'])->name('api.onepanel.installedlist');
 Route::post('/test',[IndexController::class,'test'])->name('api.test');
 Route::post('/register',[IndexController::class,'register'])->name('api.register');
 Route::post('/login',[IndexController::class,'login'])->name('api.login');
 Route::post('/newactivity',[IndexController::class,'login'])->name('api.newactivity');
 Route::post('/editactivity',[IndexController::class,'login'])->name('api.editactivity');
 Route::post('/delactivity',[IndexController::class,'login'])->name('api.delactivity');
 Route::post('/newform',[IndexController::class,'login'])->name('api.newform');
 Route::post('/editform',[IndexController::class,'login'])->name('api.editform');
 Route::post('/delform',[IndexController::class,'login'])->name('api.delform');
 Route::post('/newformitem',[IndexController::class,'login'])->name('api.newformitem');
 Route::post('/editformitem',[IndexController::class,'login'])->name('api.editformitem');
 Route::post('/delformitem',[IndexController::class,'login'])->name('api.delformitem');
 Route::post('/newformsubmit',[IndexController::class,'login'])->name('api.newformsubmit');
 Route::post('/editformsubmit',[IndexController::class,'login'])->name('api.editformsubmit');
 Route::post('/delformsubmit',[IndexController::class,'login'])->name('api.delformsubmit');
 Route::post('/newupload',[IndexController::class,'login'])->name('api.newupload');
 Route::post('/editupload',[IndexController::class,'login'])->name('api.editupload');
 Route::post('/delupload',[IndexController::class,'login'])->name('api.delupload');
 Route::post('/listactivity',[IndexController::class,'login'])->name('api.listactivity');
 Route::post('/joinactivity',[IndexController::class,'login'])->name('api.joinactivity');
 Route::post('/exitactivity',[IndexController::class,'login'])->name('api.exitactivity');
 Route::post('/live/roommemberlist',[ActivityController::class,'getRoomMemberList']);
 Route::post('/live/makeroomrobot',[ActivityController::class,'incRobot2Room']);
 Route::post('/live/moverobot2room',[ActivityController::class,'addRobot2Room']);
 Route::post('/live/removerobotfromroom',[ActivityController::class,'delRobot2Room']);
 Route::post('/live/roommembersize',[ActivityController::class,'getRoomMemberSize']);
 Route::post('/shop/changepoints',[ShopController::class,'setPoints'])->name("api.shop.changepoints");
 Route::post('/shop/setpoints',[ActivityController::class,'sendGroupPoints'])->name("api.shop.setpoints");
 Route::post('/shop/getpoints',[ActivityController::class,'grabGroupPoints']);
 Route::match(['POST','GET'],'/shop/remainpoints',[ShopController::class,'pointsBalance']);
 Route::match(['POST','GET'],'/shop/chargepointsloglist',[ShopController::class,'chargePointsLogList']);
 Route::match(['POST','GET'],'/shop/getpointsstatus',[ActivityController::class,'queryLiveRoomStatus']);
 Route::match(['POST','GET'],'/live/onsendcomment',[ActivityController::class,'onLiveRoomSendMsg']);
 Route::match(['POST','GET'],'/live/onsharegroup',[ActivityController::class,'onLiveRoomShareGroup']);
 Route::match(['POST','GET'],'/shop/getpointsstatus',[ActivityController::class,'queryLiveRoomStatus']);
 Route::match(['POST'],'/shop/refreshroomlist',[ActivityController::class,'refreshRoomList']);
 Route::match(['POST'],'/shop/getlivedatascreen',[ShopController::class,'getLiveDataScreen']);
 Route::match(['POST'],'/shop/getliveroominfo',[ShopController::class,'getRoomInfo']);
 Route::match(['POST'],'/shop/getliveroomchatlist',[ShopController::class,'getLiveRoomChatMsgList']);
});